<?php

/**
 * @Author: Wang Chunsheng 2192138785@qq.com
 * @Date:   2020-03-01 20:56:37
 * @Last Modified by:   Wang Chunsheng 2192138785@qq.com
 * @Last Modified time: 2020-03-14 16:42:27
 */


use common\models\DdGoods;
use yii\helpers\Html;
use common\widgets\MyActiveForm;
use yii\helpers\ArrayHelper;
use common\components\LevelTpl;
use yii\helpers\Url;

//use \http\Url;
/* @var $this yii\web\View */
/* @var $model common\models\DdGoods */
/* @var $form yii\widgets\MyActiveForm */
?>

<div class="dd-goods-form">


    <?= $form->field($model, 'goods_name')->textInput(['maxlength' => true]) ?>

    <!--一级目录--> <?= $form->field($model, 'category_pid')->dropDownList($Helper->courseCateMap(), [
                    'prompt' => ['text' => '一级分类', 'options' => ['value' => 0]],
                    'label' => '一级分类',
                    'id' => 'classsearch-cocate_id'
                ])->label('一级分类') ?>

    <!--二级目录--><?= $form->field($model, 'category_id')->dropDownList($Helper->courseMap($model->category_id), [
                    // 'options' => ['5' => ['selected' => true]],
                    'prompt' => ['text' => '二级分类', 'options' => ['value' => 0]],

                    'id' => 'classsearch-course_id'
                ])->label('二级分类 ') ?>

    <?= $form->field($model, 'line_price')->textInput() ?>
    <?= $form->field($model, 'goods_price')->textInput() ?>
    <?= $form->field($model, 'stock')->textInput() ?>

    <?= $form->field($model, 'deduct_stock_type')->radioList([
        '10' => '下单减库存',
        '20' => '支付减库存',
    ], ['style' => 'padding-top:7px;']) ?>

    <?= $form->field($model, 'thumb')->widget('manks\FileInput', [])->label('商品主图'); ?>

    <?= $form->field($model, 'images')->widget('manks\FileInput', ['clientOptions' => [
        'pick' => [
            'multiple' => true,
        ]
    ]])->label('商品相册'); ?>

    <?= $form->field($model, 'sales_initial')->textInput() ?>

    <?= $form->field($model, 'goods_sort')->textInput() ?>

    <?= $form->field($model, 'delivery_id')->textInput() ?>

    <?= $form->field($model, 'goods_status')->radioList([
        '1' => '上架',
        '0' => '下架',
    ], ['style' => 'padding-top:7px;']) ?>

</div>